package com.bsoft.wx.controller;


import com.bsoft.wx.pojo.SysConfig;
import com.bsoft.wx.service.SysConfigService;
import com.bsoft.wx.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author hdh
 * @since 2023-01-11
 */
@Slf4j
@RestController
@Api("测试web接口")
@RequestMapping("/sys-config")
public class SysConfigController {

    @Autowired
    private SysConfigService sysConfigService;

    @GetMapping("/test")
    @ApiOperation("最简单的测试方法")
    public R test() {
        List<SysConfig> list = sysConfigService.list();
        log.info("-----------" + list);
        Map<String, Object> map = new HashMap<>();
        map.put("code", HttpStatus.SC_OK);
        map.put("data", list);
        return R.ok(map);

    }
}

